﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using AD.Model;
using AD.DAL;

namespace AD.BLL
{
  public  class ManagerUserBLL
    {
        public static ManagerUserMod SignUserToModel(string userName, string passwd) {
            return ManagerUserDAL.SignUserToModel(userName, passwd);
        }
        public static DataTable GetUser(string userName)
        {
            return ManagerUserDAL.GetUser(userName);
        }
        public static bool CheckUser(string userName)
        {
            DataTable dt = GetUser(userName);
            if (dt != null && dt.Rows.Count > 0)
                return false;
            return true;
        }

        public static ManagerUserMod GetUserByIdToMod(int id)
        {
            return ManagerUserDAL.GetUserByIdToMod(id);
        }
        public static DataTable GetUserById(int id)
        {
            return ManagerUserDAL.GetUserById(id);
        }
        public static ManagerUserMod SignUser(ManagerUserMod user)
        {
            return ManagerUserDAL.SignUser(user);
        }

        public static DataTable GetUsers()
        {
            return ManagerUserDAL.GetUsers();
        }

        public static int Update(ManagerUserMod user)
        {
            return ManagerUserDAL.Update(user);
        }

        public static int Insert(ManagerUserMod user)
        {
            return ManagerUserDAL.Insert(user);
        }

        public static int Delete(ManagerUserMod user)
        {
            return ManagerUserDAL.Delete(user);
        }
        public static int Delete(int autoid)
        {
            return ManagerUserDAL.Delete(autoid);
        }
        public static List<ManagerUserMod> GetUsersToList()
        {
            return ManagerUserDAL.GetUsersToList();
        }
    }
}